//
//  RmdCollectionCell.m
//  Travel assistant
//
//  Created by 杨帆 on 16/3/10.
//  Copyright © 2016年 旅游助手. All rights reserved.
//

#import "RmdCollectionCell.h"

#define KWidth [[UIScreen mainScreen] bounds].size.width
#define KHeight [[UIScreen mainScreen] bounds].size.height

@implementation RmdCollectionCell


-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        [self addViews];
    }
    
    return self;
    
}


-(void)addViews{
    
    self.coverImageV.frame = CGRectMake(0, 0, 0.46*KWidth, 0.22*KHeight);
    
//    self.coverImageV.backgroundColor = [UIColor whiteColor];
    
    [self.contentView addSubview:self.coverImageV];
    
    self.titleLabel.frame = CGRectMake(0,0.22*KHeight, 0.46*KWidth, 0.088*KHeight);
    
    self.titleLabel.numberOfLines = 0;
    
//    self.titleLabel.backgroundColor = [UIColor whiteColor];
    
    self.titleLabel.font = [UIFont systemFontOfSize:20];
    
    [self.contentView addSubview:self.titleLabel];
    
    
    self.userImageV.frame = CGRectMake(0.015*KWidth,0.308*KHeight, 0.062*KWidth, 0.035*KHeight);
    
    
//    self.userImageV.backgroundColor = [UIColor whiteColor];
    self.userImageV.layer.cornerRadius = self.userImageV.bounds.size.width/2;
    
    self.userImageV.layer.masksToBounds = YES;
    
    [self.contentView addSubview:self.userImageV];
    
    
    self.userNameLael.frame = CGRectMake(0.092*KWidth,0.308*KHeight, 0.27*KWidth, 0.050*KHeight);
    
    self.userNameLael.numberOfLines = 0;
    
    self.userNameLael.font = [UIFont systemFontOfSize:12];
//    self.userNameLael.backgroundColor = [UIColor whiteColor];
    
    [self.contentView addSubview:self.userNameLael];
    
    
    
    
}


-(UIImageView *)coverImageV{
    
    if (!_coverImageV) {
        _coverImageV = [UIImageView new];
    }
    
    return _coverImageV;
}


-(UILabel *)titleLabel{
    
    if (!_titleLabel) {
        _titleLabel = [UILabel new];
    }
    return _titleLabel;
}

-(UIImageView *)userImageV{
    
    if (!_userImageV) {
        _userImageV = [UIImageView new];
    }
    
    return _userImageV;
}


-(UILabel *)userNameLael{
    
    if (!_userNameLael) {
        _userNameLael = [UILabel new];
    }
    
    return _userNameLael;
    
}












@end
